package com.gyg.client;

import com.gyg.domain.CloudUser;
import com.gyg.returns.RespEntity;
import com.gyg.returns.RespTable;
import com.gyg.vo.param.LoginParam;
import com.gyg.vo.param.PageParam;
import com.gyg.vo.param.SearchUserParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "cloudUserClient", url = "${cloud.box.url}")
public interface CloudUserClient {

    /**
     * 用户登陆
     * @param loginParam
     * @return
     */
    @PostMapping("/cloud-user/login")
    RespEntity login(@RequestBody LoginParam loginParam);

    /**
     * 用户信息
     * @param userId
     * @return
     */
    @GetMapping("/cloud-user/info")
    RespEntity userInfo(@RequestParam(value = "userId", required = true) Integer userId);

    /**
     * 用户列表
     * @param page
     * @param limit
     * @param column
     * @param value
     * @return
     */
    @GetMapping("/cloud-user/list")
    RespTable<List<CloudUser>> queryAllUser(@RequestParam(value = "page", required = true) Integer page,
                                            @RequestParam(value = "limit", required = true) Integer limit,
                                            @RequestParam(value = "column", required = false) String column,
                                            @RequestParam(value = "value", required = false) String value);

    /**
     * 封禁用户
     * @param userId
     * @return
     */
    @PutMapping("/cloud-user/ban")
    RespEntity cloudUserBan(@RequestParam Integer userId);

    /**
     * 解封用户
     * @param userId
     * @return
     */
    @PutMapping("/cloud-user/deBlock")
    RespEntity cloudUserDeBlock(@RequestParam Integer userId);

    /**
     * 封禁用户列表
     * @param pageParam
     * @return
     */
    @GetMapping("/cloud-user/banList")
    RespTable cloudBanUserList(@RequestParam PageParam pageParam);

    /**
     * 按照ids批量查询用户
     * @param ids
     * @return
     */
    @GetMapping("/cloud-user/ids")
    RespEntity<List<CloudUser>> queryUserByIds(@RequestParam("ids") Integer[] ids);

    /**
     * 查询全部用户
     * @return
     */
    @GetMapping("/cloud-user/all")
    RespEntity<List<CloudUser>> queryAllUser();

    /**
     * 用户性别统计
     * @return
     */
    @GetMapping("/cloud-user/sex")
    RespEntity cloudUserSex();

    /**
     * 用户地区分布-中国地图
     */
    @GetMapping("/cloud-user/chinaMap")
    RespEntity chinaMap(@RequestParam("beginDate") String beginDate,
                        @RequestParam("endDate") String endDate);

    /**
     * 用户地区分布-省份地图
     */
    @GetMapping("/cloud-user/provinceMap")
    RespEntity provinceMap(@RequestParam("province") String province,
                           @RequestParam("beginDate") String beginDate,
                           @RequestParam("endDate") String endDate);

}
